$(".tab-right-top-rig-div").click(function(){
    alert("请先登陆")
})


$.getJSON("http://localhost/yiguoshengxian/xiangqingye/comment/01-list.php", function (data) {
    // console.log(data)
    // console.log(data.length)
    // console.log(data[0].postdate.length)
    var html = ""
    if (data.length != 0) {
        for (i = 0; i < data.length; i++) {
            html += `<div class="tab-right-underUnder-detail">
                    <div class="underUnder-detail-user">
                        <img src="http://static01.yiguo.com/www/images/member/star1.jpg" alt=""
                            class="underUnder-detail-user-img">
                        <p class="underUnder-detail-user-p">${data[i].user}</p>
                        <div class="underUnder-detail-user-div">
                            “悠悦会”银卡会员
                        </div>
                    </div>
                    <div class="underUnder-detail-heading">
                        <div class="detail-heading-stars">
                        </div>
                        <div class="detail-heading-text">
                            <span class="detail-heading-text-span">商品质量：好</span>
                            <span class="detail-heading-text-span">配送服务：未知</span>
                            <span class="detail-heading-text-span">服务质量：好</span>
                        </div>
                        <div class="detail-heading-date">
                            ${data[i].postdate.substr(1,10)}
                            <span class="detail-heading-date-span">${data[i].postdate.substr(12,8)}</span>
                        </div>
                        <div class="detail-heading-comeform">
                            来自
                            <span class="heading-comeform-green">易果APP</span>
                            <div class="heading-comeform-erwei">
                                <img src="http://static01.yiguo.com/www/images/header/qrcode_app.jpg" alt="">
                                <span>扫一扫下载APP</span>
                            </div>
                        </div>
                    </div>
                    <div class="underUnder-detail-reply">
                        ${data[i].detail}
                    </div>
                </div>
                    `
                
        }
    }else{
        html=`
            <div class="tab-right-underUnder-firstdiv">暂无评论！</div>
        `
    }
    $(".tab-right-underUnder").html(html)
    var li=" "
    li=`<li>全部评论 ( ${data.length} )</li>
    <li>好评 ( ${data.length} )</li>
    <li>中评 ( 0 )</li>
    <li>差评 ( 0 )</li>
    <li>有晒单 ( 0 )</li>`
    
    $(".tab-right-underTop-ul").html(li)
})



